package org.example.myleet.p397;

import org.example.myleet.Utils.Assert;

public class Main {
    public static void main(String[] args) {
        Solution solution = new Solution();
        Assert.isTrue(0 == solution.integerReplacement(1));
        Assert.isTrue(3 == solution.integerReplacement(8));
        Assert.isTrue(4 == solution.integerReplacement(7));
        Assert.isTrue(2 == solution.integerReplacement(4));
        Assert.isTrue(32 == solution.integerReplacement(2147483647));
        for (int i = 0; i < 5; ++i) {
            createSample();
        }
    }

    private static void createSample() {
        int x = (int) (Math.random() * Integer.MAX_VALUE);
        Solution solution = new Solution();
        int answer = solution.integerReplacement(x);
        System.out.println("answer: " + answer);
        System.out.println("input: " + x);
    }
}
